package com.entities.userrole.requestmapparser;

import java.util.Map;

import com.model.user.UserRole;


public class UserRoleMapParser {

	public static UserRole fromMap ( Map <String, String[]> map ) {


		boolean errorFound = false;


		String name = null;
		try {
			name = map.get("name")[0];
			if ( name.trim().length() == 0 ) {
				name = null;
			}
		} catch ( ArrayIndexOutOfBoundsException e ) {
		}

		String description = null;
		try {
			description = map.get("description")[0];
			if ( description.trim().length() == 0 ) {
				description = null;
			}
		} catch ( ArrayIndexOutOfBoundsException e ) {
		}

		if ( errorFound ) {
		}


		UserRole template = null;
		template = new UserRole();
		template.setName(name);
		template.setDescription(description);

		return template;

	}

}
